from base64 import b64decode,b64encode
import json

def decode(data):
    result = ""
    key = "key"
    data = b64decode(data)
    for index,i in enumerate(data):
        result += chr(i ^ ord(key[index % len(key)]))
    jsonR = json.loads(result)
    return jsonR

def encode(data):
    data = json.dumps(data)
    result = ""
    key = "key"
    for index,i in enumerate(data.encode()):
        result += chr(i ^ ord(key[index % len(key)]))

    result = b64encode(result.encode()).decode()
    return result

file = "D:\Steam\steamapps\common\SlayTheSpire\saves\THE_SILENT.autosave"
with open(file,"rb") as f:
    data = f.read()

data = decode(data)
data["max_health"] *= 10
data["current_health"] *= 10
data["red"] *= 4
data["hand_size"] *= 2
data["gold"] *= 20
data = encode(data)
print(data)